#ifndef MODBUSWIG_H
#define MODBUSWIG_H

//通过客户端控制modbus slave
#include <QWidget>
#include <QtWidgets>
#include "globalval.h"
#include "mqtthandler.h"

namespace Ui {
class ModbusWig;
}

class ModbusWig : public QWidget
{
    Q_OBJECT

public:
    explicit ModbusWig(QWidget *parent = 0);
    ~ModbusWig();
    MqttHandler *mqtt;
    QString pathariopen;
    QString pathariclose;
    QString pathwindopen;
    QString pathwindclose;
    QPixmap airopen;
    QPixmap airclose;
    QPixmap windopen;
    QPixmap windclose;
signals:
    void dataDownSignal(QMQTT::Message);
protected:
    void paintEvent(QPaintEvent*);
private slots:
    void dataUpSlot(const QByteArray&);//数据接收槽函数
    // 与开按钮组信号连接
    void btnclickopenSlot(int);
    // 与关按钮组信号连接
    void btnclickcloseSlot(int);
private:
    Ui::ModbusWig *ui;
    QButtonGroup* groupopen;
    QButtonGroup* groupclose;
    void publish(QByteArray);
};

#endif // MODBUSWIG_H
